const addBtn = document.querySelector('#btn-add'),
      inputName = document.querySelector('#inputName'),
      inputPrice = document.querySelector('#inputPrice'),
      inputNum = document.querySelector('#inputNum')
      
utils.on(addBtn, 'click',()=>{
    const name = inputName.value,
          price = inputPrice.value,
          num = inputNum.value
    utils.fetch('./api/shop/add.php',{name,price,num}).then(resp=>{
        console.log(resp)
        if(resp.code===1){
            setTimeout(()=>{
                 $('#myModal').modal('hide');
                 getlist();
            },2000)
        }
    })     
})
$('#myModal').on('hidden.bs.modal', function (e) {
    inputName.value = inputNum.value = inputPrice.value = ''
})